<!doctype html>
<!--
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<html>
<head>
  <title>element script</title>
  <script src="../../../webcomponentsjs/webcomponents.js"></script>
  <link rel="import" href="../../polymer.html">
  <script src="../../../tools/test/htmltest.js"></script>
  <script src="../../../tools/test/chai/chai.js"></script>
  <link rel="import" href="element-import/import.html">
</head>
<body>
  <x-foo></x-foo>  
  <hr>
  
  <x-bar></x-bar>
  <hr>
  
  <x-zot></x-zot>
  <hr>

  <x-baz></x-baz>
  <hr>
  
  <x-qux></x-qux>
  <hr>

  <x-quux></x-quux>
  <hr>

  <!-- external script with super() -->
  <polymer-element name="x-bar" extends="x-foo">
    <template>
      Hello Lighter World [<shadow></shadow>]
    </template>
  </polymer-element>
  
  <script>
    var assert = chai.assert;
    document.addEventListener('polymer-ready', function() {
      var foo = document.querySelector('x-foo');
      assert.equal(getComputedStyle(foo).color, 'rgb(0, 0, 255)');
      //
      var bar = document.querySelector('x-bar');
      assert.equal(getComputedStyle(bar).color, 'rgb(0, 0, 255)');
      assert.equal(getComputedStyle(bar).backgroundColor, 'rgb(255, 165, 0)');
      //
      var zot = document.querySelector('x-zot');
      assert.equal(getComputedStyle(zot).color, 'rgb(0, 0, 255)');
      //
      var baz = document.querySelector('x-baz');
      assert.equal(getComputedStyle(baz).color, 'rgb(0, 0, 255)');
      assert.equal(getComputedStyle(baz).backgroundColor, 'rgb(255, 99, 71)');
      //
      var qux = document.querySelector('x-qux');
      assert.equal(getComputedStyle(qux).color, 'rgb(0, 0, 255)');
      assert.equal(getComputedStyle(qux).backgroundColor, 'rgb(0, 128, 0)');
      //
      var quux = document.querySelector('x-quux');
      assert.equal(getComputedStyle(quux).color, 'rgb(0, 0, 255)');
      assert.equal(getComputedStyle(quux).fontSize, '24px');
      done();
    });
  </script>
  
</body>
</html>
